package net.lummox.common.util;

public class RandomGen {
	private RandomGen() {
	}

	/**
	 * Generates random integer value in interval [0..maxValueExluding)
	 * 
	 * @param maxValueExluding
	 *            max value
	 * @return random integer value
	 */
	public static int getInt(int maxValueExluding) {
		int result = (int) (Math.random() * maxValueExluding);
		if (result < 0) {
			result = 0;
		} else if (result >= maxValueExluding) {
			result = maxValueExluding - 1;
		}
		return result;
	}
}
